package two_shang._9_28;

import java.util.Scanner;

//农业银行卡
public class ABCBankCard extends BankCard {
    public ABCBankCard() {
    }

    public ABCBankCard(String name, String password) {
        super(name, password);
    }

    public ABCBankCard(String name, String password, Double money) {
        super(name, password, money);
    }

    public void start() {
        System.out.println("欢迎来到中国农业银行!");
        int a = 1;
        Scanner scanner = new Scanner(System.in);
        System.out.println("依次输入你的姓名和密码:");
        ABCBankCard abcBankCard = new ABCBankCard(scanner.next(), scanner.next());
        while (a != 0) {
            System.out.println("请输入0~5之间的数字：\n0:退出\n1:存钱\n2:取钱\n3:查询余额\n4:查询密码\n5:转账");
            a = scanner.nextInt();
            switch (a) {
                case 0:
                    break;
                case 1:
                    abcBankCard.deposit(scanner.nextDouble());
                    break;
                case 2:
                    abcBankCard.withdraw(scanner.nextDouble());
                    break;
                case 3:
                    abcBankCard.queryM();
                    break;
                case 4:
                    abcBankCard.queryP();
                    break;
                case 5:
                    abcBankCard.swag(abcBankCard, scanner.nextDouble());
                    break;
                default:
                    System.out.println("请输入指定的数字!");
                    break;
            }
        }
    }

}
